import {HttpHeaders} from "@angular/common/http";

var root = "http://localhost:8088";
const disk_root="http://localhost:8003/disk"
const user_root="http://localhost:8002/user"
export let api={
  // 用户
  login:user_root + "/login",
  logout:user_root + "/logout",
  loginByCaptcha:user_root + "/loginByCaptcha",
  register:user_root + "/register",
  favorites: user_root + "/action/favorites",
  userGroups: user_root + "/action/userGroups",
  settings: user_root + "/action/settings",
  searchUser: user_root + "/action/search",
  // 用户信息
  checkName:user_root + "/info/check/name",
  checkEmail:user_root + "/info/check/mail",
  userInfo:user_root + "/info/userinfo",//完整信息
  pubInfo:user_root + "/info/pubInfo",//公共信息
  mailCaptcha: user_root + "/info/mailCaptcha",
  mailToken: user_root + "/info/mailToken",
  mailEdit: user_root + "/info/edit/mail",
  passwdEdit: user_root + "/info/edit/passwd",
  usernameEdit: user_root + "/info/edit/username",
  customEdit: user_root + "/info/edit/custom",

  messageList: user_root + "/message/list",
  messageAdd: user_root + "/message/add",
  delMessage: user_root + "/message/del",
  dealMessage: user_root + "/message/deal",
  // 文件
  list:disk_root+"/list",
  classify:disk_root+"/classify",
  filePath:disk_root+"/path",
  opera :disk_root+"/opera",
  mkdir :disk_root+"/mkdir",
  permission :disk_root+"/permission",
  searchFile: disk_root+"/search",
  fileInfo: disk_root+"/info",
  fileInfos: disk_root+"/infos",
  userRoots: disk_root+"/userRoots",
  reportFile: disk_root+"/report",
  addOffline: "http://localhost:8003/offline/add",
  offlineProgress : "http://localhost:8003/offline/progress",
  delOffline : "http://localhost:8003/offline/del",
  retryOffline : "http://localhost:8003/offline/retry",
  offlineTask : "http://localhost:8003/offline/task",
  listOffline: "http://localhost:8003/offline/list",
  preUpload: "http://localhost:8003/upload/preUpload",
  delUpload: "http://localhost:8003/upload/delUpload",
  upload: "http://localhost:8003/upload/simple",
  uploadStatus: "http://localhost:8003/upload/status",
  download: "http://localhost:8003/download",
  video: "http://localhost:8003/download/video",
  imgView: "http://localhost:8003/download/img",
  videoView: "http://localhost:8003/download/videoImg",
  //验证码
  captchaImg: "http://localhost:8001/captcha/img",
  captchaEmail: "http://localhost:8001/captcha/email",
  formHeaders:new HttpHeaders().set("content-type","application/x-www-form-urlencoded").set("charset","utf-8"),
  jsonHeaders: new HttpHeaders().set("content-type","application/json").set("charset","utf-8"),
  getAvatar: 'http://localhost:8003/download/avatar'
}
